[PULL REQUEST] Startup Module - Blockgroups, Validation, Debug#211
Open
GregorSchroeder wants to merge 3 commits intomainfrom
Open
[PULL REQUEST] Startup Module - Blockgroups, Validation, Debug#211GregorSchroeder wants to merge 3 commits intomainfrom
GregorSchroeder wants to merge 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Startup module to support Census blockgroup geographies in the [inputs].[mgra] table and adds validation + debug behavior by splitting the former “insert-only” SQL into a “get/insert switch” query plus Python orchestration.
Changes:
- Add
[2010_census_blockgroup]and[2020_census_blockgroup]columns to[inputs].[mgra]schema definition. - Replace
sql/insert_mgra.sqlwithsql/startup/get_mgra.sql, supporting both “return tabular data” and “insert with geometry” modes. - Update
python/startup.pyto fetch MGRA data into pandas for validation and to write debug CSV output.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
sql/startup/get_mgra.sql |
New Startup MGRA loader query with @insert_switch behavior and added blockgroup xrefs |
sql/insert_mgra.sql |
Removed legacy single-purpose insert script |
sql/create_objects.sql |
Updates [inputs].[mgra] DDL to include the new blockgroup columns (plus added GO separators) |
python/startup.py |
Adds Python-side validation and debug CSV output; switches to new SQL loader |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Eric-Liu-SANDAG
requested changes
Apr 1, 2026
Contributor
Eric-Liu-SANDAG
left a comment
There was a problem hiding this comment.
Need to update wiki files
Contributor
There was a problem hiding this comment.
[xref_id]=87in[GeoAnalyst]says "Many-to-many cross-reference between Series 15 MGRAs and 2010 Census Block Groups..." instead of "Many-to-many cross-reference between MGRA15 points and 2010 Census Block Groups..."- It is necessary to document why we sometimes use point based vs area based xrefs? Maybe something to add to the wiki?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe this pull request. What changes are being made?
Census blockgroups are added to the
[inputs].[mgra]table and inserted along with MGRA data as part of the Startup Module.The Startup Module is given both Validation and Debug functionality by altering the original
sql/insert_mgra.sqlSQL statement and replacing it withsql/startup/get_mgra.sqland additional Python logic.What issues does this pull request address?
closes #209
closes #210
Additional context
See
[run_id]=13in[ws].The following queries will be run in the production database.